
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,1,1,20120101,20120107);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,1,2,20120108,20120114);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,1,3,20120115,20120121);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,1,4,20120122,20120128);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,1,5,20120129,20120204);

insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,2,1,20120205,20120211);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,2,2,20120212,20120218);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,2,3,20120219,20120225);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,2,4,20120215,20120303);

insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,3,1,20120304,20120310);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,3,2,20120310,20120317);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,3,3,20120318,20120324);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,3,4,20120325,20120331);

insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,4,1,20120401,20120407);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,4,2,20120408,20120414);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,4,3,20120415,20120421);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,4,4,20120422,20120428);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,4,5,20120429,20120505);

insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,5,1,20120506,20120512);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,5,2,20120513,20120519);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,5,3,20120520,20120526);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,5,4,20120527,20120602);

insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,6,1,20120603,20120609);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,6,2,20120610,20120616);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,6,3,20120617,20120623);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,6,4,20120624,20120630);

insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,7,1,20120701,20120707);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,7,2,20120708,20120714);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,7,3,20120715,20120721);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,7,4,20120722,20120728);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,7,5,20120729,20120804);

insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,8,1,20120805,20120811);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,8,2,20120812,20120818);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,8,3,20120819,20120825);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,8,4,20120826,20120901);

insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,9,1,20120902,20120908);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,9,2,20120909,20120915);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,9,3,20120916,20120922);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,9,4,20120923,20120929);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,9,5,20120930,20121006);

insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,10,1,20121007,20121013);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,10,2,20121014,20121020);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,10,3,20121021,20121027);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,10,4,20121028,20121103);

insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,11,1,20121104,20121110);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,11,2,20121111,20121117);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,11,3,20121118,20121124);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,11,4,20121125,20121201);

insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,12,1,20121202,20121208);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,12,2,20121209,20121215);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,12,3,20121216,20121222);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,12,4,20121223,20121229);
insert into best_weekly (best_pri_week,year,month,week,s_day,l_day) values(best_weekly_seq.nextVal,2012,12,5,20121230,20130105);

select * from best_weekly;

delete from BEST_WEEKLY where best_pri_week=57

select b.best_pri_week, b.year, b.month, b.week, g.category
from BEST_WEEKLY b, gallery g
where b.best_pri_week=g.best_pri_week

select count(*) from gallery where category='art'

select *
from
(select w.best_pri_week,w.month,w.week,a.practice,b.series,c.art
from BEST_WEEKLY w 
left outer join
	(select b.best_pri_week,month,week,g.category,count(g.category) as practice
from  BEST_WEEKLY b,GALLERY g 
where  b.best_pri_week=g.best_pri_week and g.category ='practice' 
group by b.best_pri_week,month,week,g.category) a
on w.best_pri_week=a.best_pri_week
left outer join
(select b.best_pri_week,month,week,g.category,count(g.category) as series
from  BEST_WEEKLY b,GALLERY g 
where  b.best_pri_week=g.best_pri_week and g.category ='series' 
group by b.best_pri_week,month,week,g.category) b
on w.best_pri_week=b.best_pri_week
left outer join
(select b.best_pri_week,month,week,g.category,count(g.category) as art
from  BEST_WEEKLY b,GALLERY g 
where  b.best_pri_week=g.best_pri_week and g.category ='art' 
group by b.best_pri_week,month,week,g.category) c
on w.best_pri_week=c.best_pri_week)
order by best_pri_week desc